//
//  CustomButton.m
//  GIFShow
//
//  Created by lanou11air029 on 15/4/3.
//  Copyright (c) 2015年 CK. All rights reserved.
//

#import "CustomButton.h"

@interface CustomButton ()
//@property(nonatomic)          UIEdgeInsets contentEdgeInsets UI_APPEARANCE_SELECTOR; // default is UIEdgeInsetsZero
//@property(nonatomic)          UIEdgeInsets titleEdgeInsets;                // default is UIEdgeInsetsZero
//@property(nonatomic)          BOOL         reversesTitleShadowWhenHighlighted; // default is NO. if YES, shadow reverses to shift between engrave and emboss appearance
//@property(nonatomic)          UIEdgeInsets imageEdgeInsets;

@end
@implementation CustomButton

+(instancetype)buttonWithType:(UIButtonType)buttonType{
    CustomButton * btn = [super buttonWithType:buttonType];
    
    btn.imageView.contentMode = UIViewContentModeScaleAspectFit;
    
//    btn.titleLabel.highlightedTextColor = [UIColor yellowColor];
//    btn.titleLabel.textColor = [UIColor redColor];
    return btn;

}
- (CGRect)titleRectForContentRect:(CGRect)contentRect{

   return CGRectMake(self.frame.size.height+2, 0, self.frame.size.width - self.frame.size.height, self.frame.size.height);
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect{

    return CGRectMake(1.5, 1.5, self.frame.size.height-3, self.frame.size.height-3);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
